# -*- coding: utf-8 -*-
"""
__title__ = ''
__author__ = 'Yang'
__mtime__ = '2019/1/21 10:46'
# code is far away from bugs with the god animal protecting
    I love animals. They taste delicious.
              ┏┓      ┏┓
            ┏┛┻━━━┛┻┓
            ┃      ☃      ┃
            ┃  ┳┛  ┗┳  ┃
            ┃      ┻      ┃
            ┗━┓      ┏━┛
                ┃      ┗━━━┓
                ┃  神兽保佑    ┣┓
                ┃　永无BUG！   ┏┛
                ┗┓┓┏━┳┓┏┛
                  ┃┫┫  ┃┫┫
                  ┗┻┛  ┗┻┛
"""
import pymysql
import pandas as pd
from sqlalchemy import create_engine

pd.set_option('display.max_rows', 3000)
conn = create_engine('mysql+pymysql://root:123@localhost:3306/pc?charset=utf8')
df = pd.read_csv('jd_data.csv', usecols=range(0, 9),
                 names='goods_id,shop_name,pro_name,price,shop_star,shop_goods_score,shop_logistics_score,shop_after_sale_score,comment_count,good_count,good_rate'.split(
                     ',')
                 , )

print()

# df.to_sql('huawei', con=conn, if_exists='replace', index=False)
print(df.shape)
df.drop_duplicates(inplace=True)
print(df.shape)